//
//  SCFormModel.h
//  Shuaiche
//
//  Created by 党帅 on 2019/7/30.
//  Copyright © 2019 zzs. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol SCFormModel <NSObject>

- (NSString *)titleString;

@end

@interface SCFormModel : NSObject<SCFormModel>

@property (nonatomic, copy) NSString *key;
@property (nonatomic, copy) NSString *value;
@property (nonatomic, copy) NSString *title;
@property(nonatomic, assign) CGFloat height;
@property (nonatomic, copy) NSString *cellView;
@property (nonatomic, copy) NSString *imageName;

@property (nonatomic, copy) void(^valueChanged)(NSString *value);

@end


@interface SCFormSectionModel : NSObject<SCFormModel>

@property (nonatomic, copy) NSString *sectionKey;

@property (nonatomic, copy) NSString *headerView;
@property (nonatomic, copy) NSString *headerTitle;
@property(nonatomic, assign) CGFloat headerHeight;


@property (nonatomic, copy) NSString *footerView;
@property (nonatomic, copy) NSString *footerTitle;
@property(nonatomic, assign) CGFloat footerHeight;

@property (nonatomic, strong) NSMutableArray *rows;
@property(nonatomic, assign) CGFloat rowHeight;
@property (nonatomic, copy) NSString *cellView;


+ (SCFormSectionModel *)sectionWithRowKeys:(NSArray *)keys;

+ (SCFormSectionModel *)sectionWithRowValues:(NSArray *)values;

- (void)addForm:(SCFormModel *)model;

- (void)addFormsFromKeys:(NSArray *)keys;

- (NSInteger)rowHeightForIndex:(NSIndexPath *)indexPath;

@end



